package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiSrtpRouteMapper;
import com.ruoyi.net.domain.BusiSrtpRoute;
import com.ruoyi.net.service.IBusiSrtpRouteService;

/**
 * 业务-srtp-路径配置Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class BusiSrtpRouteServiceImpl implements IBusiSrtpRouteService 
{
    @Autowired
    private BusiSrtpRouteMapper busiSrtpRouteMapper;

    /**
     * 查询业务-srtp-路径配置
     * 
     * @param id 业务-srtp-路径配置主键
     * @return 业务-srtp-路径配置
     */
    @Override
    public BusiSrtpRoute selectBusiSrtpRouteById(String id)
    {
        return busiSrtpRouteMapper.selectBusiSrtpRouteById(id);
    }

    /**
     * 查询业务-srtp-路径配置列表
     * 
     * @param busiSrtpRoute 业务-srtp-路径配置
     * @return 业务-srtp-路径配置
     */
    @Override
    public List<BusiSrtpRoute> selectBusiSrtpRouteList(BusiSrtpRoute busiSrtpRoute)
    {
        return busiSrtpRouteMapper.selectBusiSrtpRouteList(busiSrtpRoute);
    }

    /**
     * 新增业务-srtp-路径配置
     * 
     * @param busiSrtpRoute 业务-srtp-路径配置
     * @return 结果
     */
    @Override
    public int insertBusiSrtpRoute(BusiSrtpRoute busiSrtpRoute)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiSrtpRoute.getId())) {
            busiSrtpRoute.setId(uuid);
        }
        busiSrtpRoute.setCreateBy(SecurityUtils.getUsername());
        busiSrtpRoute.setCreateTime(DateUtils.getNowDate());
        busiSrtpRoute.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRoute.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteMapper.insertBusiSrtpRoute(busiSrtpRoute);
    }

    /**
     * 修改业务-srtp-路径配置
     * 
     * @param busiSrtpRoute 业务-srtp-路径配置
     * @return 结果
     */
    @Override
    public int updateBusiSrtpRoute(BusiSrtpRoute busiSrtpRoute)
    {
        busiSrtpRoute.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRoute.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteMapper.updateBusiSrtpRoute(busiSrtpRoute);
    }

    /**
     * 批量删除业务-srtp-路径配置
     * 
     * @param ids 需要删除的业务-srtp-路径配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteByIds(String[] ids)
    {
        return busiSrtpRouteMapper.deleteBusiSrtpRouteByIds(ids);
    }

    /**
     * 删除业务-srtp-路径配置信息
     * 
     * @param id 业务-srtp-路径配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteById(String id)
    {
        return busiSrtpRouteMapper.deleteBusiSrtpRouteById(id);
    }
}
